package com.twu.biblioteca;

import java.io.ByteArrayInputStream;
import java.util.ArrayList;

/**
 * Created by fish on 14-7-16.
 */
public class MockConsole implements IConsole {
    private ArrayList<String> output = new ArrayList<>();

    @Override
    public void writeLine(String line) {
        output.add(line);
    }

    public ArrayList<String> getOutput() {
        return output;
    }

    public void input(String s) {
        System.setIn(new ByteArrayInputStream(s.getBytes()));
    }
}
